package org.ztr.yanai.ai.controller.prompt;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.ztr.yanai.ai.service.PromptTemplateService;
import reactor.core.publisher.Flux;

/**
 * @Author: ZhaoTR
 * @Date: Created in 2025/11/1 16:11
 * @Description: 测试 PromptTemplate（调用 Service）
 * @Version: 1.0
 */

@RestController
@RequestMapping("/ai")
public class PromptTemplateController {

    private final PromptTemplateService promptTemplateService;

    public PromptTemplateController(
            PromptTemplateService promptTemplateService
    ) {
        this.promptTemplateService = promptTemplateService;
    }

    @GetMapping("/prompttemplate/chat")
    public Flux<String> chat(String topic, String outputFormat, String wordCount) {
        return promptTemplateService.chat(topic, outputFormat, wordCount);
    }

    @GetMapping("/prompttemplate/chat2")
    public String chat2(String topic, String outputFormat) {
        return promptTemplateService.chat2(topic, outputFormat);
    }

    @GetMapping("/prompttemplate/chat3")
    public String chat3(String sysTopic, String userTopic) {
        return promptTemplateService.chat3(sysTopic, userTopic);
    }

    @GetMapping("/prompttemplate/chat4")
    public String chat4(String question) {
        return promptTemplateService.chat4(question);
    }

    @GetMapping("/prompttemplate/chat5")
    public Flux<String> chat5(String question) {
        return promptTemplateService.chat5(question);
    }
}
